﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
	<title>延续子流程</title>
	 <link href="../../Comm/Style/CommStyle.css" rel="stylesheet" type="text/css" />
    <link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet"  type="text/css" />
    <link href="../../Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../Comm/Gener.js"></script>
    <script src="../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
	<base target="_self" />
	<script type="text/javascript">
	    //打开窗体.
	    function OpenEasyUiDialogExt(url, title, w, h, isReload) {

	        OpenEasyUiDialog(url, "eudlgframe", title, w, h, "icon-property", true, null, null, null, function () {
	            if (isReload == true) {
	                window.location.href = window.location.href;
	            }
	        });
	    }

	    //页面启动函数.
	    $(function () {

	        $("#Msg").html("<img src=../../Img/loading.gif />&nbsp;正在加载,请稍后......");

	        //求出来已经设置的延续子流程.
	        var nodeID = GetQueryString("FK_Node");
	        var ens = new Entities("BP.WF.Template.NodeYGFlows");
	        ens.Retrieve("FK_Node", nodeID);
	        console.log(ens);
	        var html = "";
	        for (var i = 0; i < ens.length; i++) {
	            var en = ens[i];
	            html += "<tr>";
	            html += "<td class=Idx>" + (i+1) + "</td>";
	            html += "<td>" + en.FK_FlowText + "</td>";
	          //  html += "<td>" + en.YGWorkWayText + "</td>";
	            html += "<td><a href=\"javascript:Edit('" + en.OID + "');\" >编辑</a></td>";
	            html += "<td><a href=\"javascript:Delete('" + en.OID + "');\" >删除</a></td>";
	            html += "</tr>";
	        }

	        $("#Table1 tr:last").after(html);

	        $("#Msg").html("");

	    });

        //查询集团的流程.
	    function AddGroup() {
	        var webUser = new WebUser();
	        var url = "NodeYGFlowDtl.htm?FK_Node=" + GetQueryString("FK_Node") + "&OrgNo=" + webUser.GroupNo;
	        OpenEasyUiDialogExt(url, "选择子流程", 900, 600, true);
	    }
	    //查询集团的流程.
	    function AddOrg() {
	        var webUser = new WebUser();
	        var url = "NodeYGFlowDtl.htm?FK_Node=" + GetQueryString("FK_Node") + "&OrgNo=" + webUser.FK_Dept;
	        OpenEasyUiDialogExt(url, "选择子流程", 900, 600, true);
	    }

        //删除成功.
        function Delete(pk) {

            if (confirm('您确定要删除吗？') == false)
                return;

            var en = new Entity("BP.WF.Template.NodeYGFlow", pk);
            en.Delete();
            window.location.href = window.location.href;
        }
        //编辑.
        function Edit(pk) {

            var url = "../../Comm/RefFunc/EnOnly.htm?EnName=BP.WF.Template.NodeYGFlow&PKVal=" + pk;

            OpenEasyUiDialogExt(url, '编辑', 900, 600, true);
            //window.location.href = url;

        }
        function Help() {
            var url = "http://ccbpm.mydoc.io";
            window.open(url);
        }
    </script>
</head>
<body>
	<table id="Table1" style="width: 100%">
		
        <caption>延续子流程</caption>

        <tr>
        <th>序</th>
        <th>流程名称</th>
        <th>编辑</th>
        <th>删除</th>
        </tr>
	</table>

    <br />

    <input type=button value="增加集团子流程" onclick="AddGroup()" />
    <input type=button value="增加本组织子流程" onclick="AddOrg()" />
    <input type=button value="我需要帮助" onclick="Help()" />


	<div id="Msg">
	</div>
<!--
    <fieldset>
					<legend>填写帮助</legend>
					<ul>
						<li>延续流程就是当前的子流程.</li>
						<li>延续流程是子流程的一种,该子流程只能被发起一次.</li>
					</ul>
				</fieldset>-->
</body>
</html>
